package session

import (
	"context"

	"github.com/gogf/gf/v2/container/gvar"
	"github.com/gogf/gf/v2/frame/g"
)

type Session struct{}

func New() *Session {
	return &Session{}
}

func (s *Session) Set(ctx context.Context, key string, value interface{}) {
	g.RequestFromCtx(ctx).Session.MustSet(key, value)
}

func (s *Session) Get(ctx context.Context, key string) *gvar.Var {
	return g.RequestFromCtx(ctx).Session.MustGet(key)
}

func (s *Session) Remove(ctx context.Context, keys ...string) {
	g.RequestFromCtx(ctx).Session.MustRemove(keys...)
}
